package com.ag.lzm.action;

import java.util.List;

import com.ag.bean.TbRole;
import com.ag.common.AjaxNotify;
import com.ag.common.BaseAction;
import com.ag.lzm.service.IRoleService;

/**
 * 系统角色处理Action
 * 
 * @author 黎肇明
 */
public class RoleAction extends BaseAction {
	private IRoleService roleService;
	private List<TbRole> roleList;// 角色列表，用于异步返回的数据载体
	private String ajaxRst;// 异步连接结果反馈
	private static final long serialVersionUID = -7227430859395331460L;

	public List<TbRole> getRoleList() {
		return roleList;
	}

	/**
	 * 查询系统所有角色信息
	 * 
	 * @author 黎肇明
	 */
	public String findAllRole() {
		try {
			roleList = roleService.findAll();// 调用服务层接口
			ajaxRst = AjaxNotify.SUCCESS;// 填写异步反馈信息
			return "find_all_role";// Struts2 json结果视图选择
		} catch (Exception e) {
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	public String getAjaxRst() {
		return ajaxRst;
	}

	public void setRoleService(IRoleService roleService) {
		this.roleService = roleService;
	}

}
